home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIGnomeVFSService.idl < prev    next >
Text File  |  2006-05-08  |  6KB  |  151 lines

  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is the Mozilla GNOME integration code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * IBM Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 2004
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *  Brian Ryner <bryner@brianryner.com>
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40.  
  41. interface nsIUTF8StringEnumerator;
  42. interface nsIURI;
  43.  
  44. /* nsIGnomeVFSMimeApp holds information about an application that is looked up
  45.    with nsIGnomeVFSService::GetAppForMimeType. */
  46.  
  47. [scriptable, uuid(99ae024f-e869-4973-958b-54768a84295a)]
  48. interface nsIGnomeVFSMimeApp : nsISupports
  49. {
  50.   const long EXPECTS_URIS  = 0;
  51.   const long EXPECTS_PATHS = 1;
  52.   const long EXPECTS_URIS_FOR_NON_FILES = 2;
  53.  
  54.   readonly attribute AUTF8String         id;
  55.   readonly attribute AUTF8String         name;
  56.   readonly attribute AUTF8String         command;
  57.   readonly attribute boolean             canOpenMultipleFiles;
  58.   readonly attribute long                expectsURIs;  // see constants above
  59.   readonly attribute nsIUTF8StringEnumerator supportedURISchemes;
  60.   readonly attribute boolean             requiresTerminal;
  61. };
  62.  
  63. /*
  64.  * The VFS service makes use of two distinct registries.
  65.  *
  66.  * The application registry holds information about applications (uniquely
  67.  * identified by id), such as which MIME types and URI schemes they are
  68.  * capable of handling, whether they run in a terminal, etc.
  69.  *
  70.  * The MIME registry holds information about MIME types, such as which
  71.  * extensions map to a given MIME type.  The MIME registry also stores the
  72.  * id of the application selected to handle each MIME type.
  73.  */
  74.  
  75. [scriptable, uuid(4d6b9f23-8682-41b3-bbff-937a958e6496)]
  76. interface nsIGnomeVFSService : nsISupports
  77. {
  78.   /*** Application registry methods ***/
  79.  
  80.   /* string keys */
  81.   const long APP_KEY_COMMAND = 0;
  82.   const long APP_KEY_NAME = 1;
  83.   const long APP_KEY_SUPPORTED_URI_SCHEMES = 2;  /* comma-separated list */
  84.   const long APP_KEY_EXPECTS_URIS = 3; /* "true", "false", or "non-file" */
  85.  
  86.   /* Set one of the above string keys for the given application id.
  87.      'id' can be an arbitrary, unique string to identify the application. */
  88.   void               setAppStringKey(in AUTF8String id,
  89.                                      in long        key,  /* see enums above */
  90.                                      in AUTF8String value);
  91.  
  92.   /* boolean keys */
  93.   const long APP_KEY_CAN_OPEN_MULTIPLE = 4;
  94.   const long APP_KEY_REQUIRES_TERMINAL = 5;
  95.  
  96.   /* Set one of the above boolean keys for the given application id.
  97.      'id' can be an arbitrary, unique string to identify the application. */
  98.   void               setAppBoolKey(in AUTF8String id,
  99.                                    in long        key,
  100.                                    in boolean     value);
  101.  
  102.  
  103.   /* Add a MIME type to the list of types that the application can handle */
  104.   void               addMimeType(in AUTF8String id,
  105.                                  in AUTF8String mimeType);
  106.  
  107.   /* Commit application registry changes to disk.  This must be called
  108.      to save changes. */
  109.   void               syncAppRegistry();
  110.  
  111.  
  112.   /*** MIME registry methods ***/
  113.  
  114.   /* Obtain the MIME type registered for an extension.  The extension
  115.      should not include a leading dot. */
  116.   AUTF8String        getMimeTypeFromExtension(in AUTF8String extension);
  117.  
  118.   /* Obtain the preferred application for opening a given MIME type */
  119.   nsIGnomeVFSMimeApp getAppForMimeType(in AUTF8String mimeType);
  120.  
  121.   /* Set the preferred application for opening a given MIME type */
  122.   void               setAppForMimeType(in AUTF8String mimeType,
  123.                                        in AUTF8String id);
  124.  
  125.   /* Obtain a description for the given MIME type */
  126.   AUTF8String        getDescriptionForMimeType(in AUTF8String mimeType);
  127.  
  128.   /* Set the icon for a MIME type, which will be searched for by the shell
  129.      using the icon theme search path. */
  130.   void               setIconForMimeType(in AUTF8String mimeType,
  131.                                         in AUTF8String iconPath);
  132.  
  133.   /*
  134.    * Set the list of extensions for a given MIME type.
  135.    * Should be passed a space separated list of extensions with no
  136.    * dot, i.e. "gif jpg png".
  137.    */
  138.   void setMimeExtensions(in AUTF8String mimeType,
  139.                          in AUTF8String extensionsList);
  140.  
  141.  
  142.   /*** Misc. methods ***/
  143.  
  144.   /* Open the given URI in the default application */
  145.   void               showURI(in nsIURI uri);
  146. };
  147.  
  148. %{C++
  149. #define NS_GNOMEVFSSERVICE_CONTRACTID "@mozilla.org/gnome-vfs-service;1"
  150. %}
  151.